package com.hrg.seer.sdk.rbk.msg.config;

import com.hrg.seer.sdk.rbk.msg.BaseRes;
import lombok.Data;

import java.util.List;

@Data
public class ConfigDownloadMapRes extends BaseRes {
	private Header header;
	private List<Object> normalPosList;
	private List<AdvancedPoint> advancedPointList;
	private List<AdvancedCurve> advancedCurveList;
	private List<Object> advancedAreaList;
	private List<Object> tagPosList;
	@Data
	public static class Header {
		private String mapType;
		private String mapName;
		private Position minPos;
		private Position maxPos;
		private double resolution;
		private String version;

		/*public Header() {
			mapType = "2D-Map";
			mapName = "SeerMap";
			Position minPosition = new Position();
			minPosition.x = 999.99;
			minPosition.y = 999.99;
			minPos = minPosition;

			Position maxPosition = new Position();
			maxPosition.x = -999.99;
			maxPosition.y = -999.99;
			maxPos = maxPosition;

			resolution = 0.02;
			version = "1.0.6";
		}*/
	}


	@Data
	public static class Position {
		public double x;
		public double y;
	}

	@Data
	public static class AdvancedPoint {
		private String className;
		private String instanceName;
		private Position pos;
		private List<Property> property;
		private boolean ignoreDir;
		private Double dir;
	}

	@Data
	public static class Property {
		private String key;
		private String type;
		private String value;
		private Boolean boolValue; // 注意：需要在反序列化时将"value"解码为布尔值
		private Integer int32Value; // 注意：对于"type"为'int'的情况，需要将"value"解码为整数值
		private Double doubleValue;
		private String stringValue;
	}

	@Data
	public static class AdvancedCurve {
		private String className;
		private String instanceName;
		private StartEndPosition startPos;
		private StartEndPosition endPos;
		private ControlPosition controlPos1;
		private ControlPosition controlPos2;
		private List<Property> property;
	}

	@Data
	public static class StartEndPosition {
		private String instanceName;
		private Position pos;
	}

	@Data
	public static class ControlPosition {
		private double x;
		private double y;
	}
}
